package com.touch.sound;
import java.net.*;
public class MediaPlayer 
{
	protected MidiPlayer midiCodec = new MidiPlayer();
	protected MpegPlayer mpegCodec = new MpegPlayer();
	
	public void loop(final String code)
	{
		try
		{
			midiCodec.load(new URL(code));
			mpegCodec.load(new URL(code));
			midiCodec.loop();
			mpegCodec.loop();
		}
		catch (MalformedURLException e) 
		{		
			e.printStackTrace();
		}
	}
	public void stop()
	{
		midiCodec.pauseAudio();
		mpegCodec.pauseAudio();
	}
}
